<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		红<select id="rSel" onchange="change()"></select>
		绿<select id="gSel" onchange="change()"></select>
		蓝<select id="bSel" onchange="change()"></select>
		<script type="text/javascript">
			function change() {
				console.log("发生改变")
				alert("发生改变")
				var r = rSel.value;
				var g = gSel.value;
				var b = bSel.value;
				document.body.style.background ="rgb("+r+","+g+","+b+")"

			}
			for (var i = 0; i <= 255; i++) {
				var o = document.createElement("option");
				o.value = i;
				var t = document.createTextNode(i);
				o.appendChild(t);
				rSel.appendChild(o);
			}
			for (var i = 0; i <= 255; i++) {
				var o = document.createElement("option");
				o.value = i;
				var t = document.createTextNode(i);
				o.appendChild(t);
				gSel.appendChild(o);
			}
			for (var i = 0; i <= 255; i++) {
				var o = document.createElement("option");
				o.value = i;
				var t = document.createTextNode(i);
				o.appendChild(t);
				bSel.appendChild(o);
			}
		</script>
	</body>
</html>
